home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
PIL
/
ImageEnhance.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
46 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
import Image
import ImageFilter
class _Enhance:
def enhance(self, factor):
return Image.blend(self.degenerate, self.image, factor)
class Color(_Enhance):
def __init__(self, image):
self.image = image
self.degenerate = image.convert('L').convert(image.mode)
class Contrast(_Enhance):
def __init__(self, image):
self.image = image
mean = reduce((lambda a, b: a + b), image.convert('L').histogram()) / 256
self.degenerate = Image.new('L', image.size, mean).convert(image.mode)
class Brightness(_Enhance):
def __init__(self, image):
self.image = image
self.degenerate = Image.new(image.mode, image.size, 0)
class Sharpness(_Enhance):
def __init__(self, image):
self.image = image
self.degenerate = image.filter(ImageFilter.SMOOTH)